[gd_resource type="Shader" format=2]

[resource]
code = "shader_type canvas_item;

uniform sampler2D normal;
uniform float height;

void fragment(){

	vec3 norm = texture(normal,UV).rgb;
	NORMAL = vec3(norm.rg*vec2(-2.0,2.0)-vec2(-1.0,1.0),norm.b);
	COLOR = texture(TEXTURE,UV)*vec4(0.25,0.25,0.25,1.0);
}

void light() {
	vec3 light_vec = -normalize(vec3(-LIGHT_VEC.x,-LIGHT_VEC.y,-(LIGHT_HEIGHT-height)));
	vec3 n = normalize(NORMAL);

	LIGHT = 1.2*vec4(vec3(dot(n,light_vec)),1.0)*COLOR*LIGHT_COLOR;
}"
